
public class FeedStarter extends StateMachine {

	public static final int BELT_SPEED = 3;
	
	private int beltNumber;
	
	public FeedStarter(int beltNumber)
	{
		this.beltNumber = beltNumber;
		
		State FeedStopped = new State(true, false, true);
		State FeedStarted = new State();
	
		Transition t1 = new Transition(FeedStarted);
		t1.setUpdate(new Update1());
		FeedStopped.addTransition(t1);
		
		currentState = FeedStopped;
		
		Const.feedBelt[beltNumber].setPower(BELT_SPEED);
	}
	
	public void run()
	{
		while(currentState.hasTransitions())
		{
			State newState = currentState.doTransition();
			
			currentState = newState;
		}
	}
	
	private class Update1 extends Update
	{		
		public void doUpdate()
		{
			Const.feedBelt[beltNumber].forward();
		}
	}
}